home *** CD-ROM | disk | FTP | other *** search
-
- #include <clib/intuition_protos.h>
- #include <clib/gadtools_protos.h>
- #include <clib/exec_protos.h>
- #include <clib/utility_protos.h>
- #include <clib/locale_protos.h>
-
- #include <stdlib.h>
- #include <string.h>
-
- #include "project.h"
-
- #define CATCOMP_NUMBERS
-
- #include "project.catalog.h"
-
- extern char PubName[];
- extern struct Catalog *Catalog;
-
- char *ProjectPathName;
- char *ProjectName;
- char *WindowTitle;
-
- char *StartDir;
- char *PrgDir;
-
- /****************************************************************************
- *** ***
- *** Fonctions divers ***
- *** ***
- ****************************************************************************/
-
- void ReplaceChar( char **dest , char *source )
- {
- free( *dest );
- *dest = strdup( source );
- }
-
- /****************************************************************
- *** Change le nom du projet en cours ***
- ****************************************************************/
-
- void ChangeProjectName( char *pathname ) {
- char temp[200];
- char *wintitle = "Project Handler : Sources Window / Project Name : ";
-
- ReplaceChar( &ProjectPathName , pathname );
- ReplaceChar( &ProjectName , BaseName( pathname ) );
- ProjectName[ strlen(ProjectName) - 4 ] = 0;
- if ( ROMVersion >=38 )
- strcpy( temp , GetCatalogStr( Catalog , MSG_WIN_TITLE_SOURCE , wintitle ) );
- else
- strcpy( temp , wintitle );
- strcat( temp , BaseName( pathname ) );
- ReplaceChar( &WindowTitle , temp );
- SetWindowTitles( ProjectWnd , WindowTitle , (UBYTE *)-1 );
- }
-
- /****************************************************************
- *** Change le nom du repertoire de DICE ***
- ****************************************************************/
-
- void ChangeDICEDir( char *dir ) {
- char *prgt;
-
- ReplaceChar( &DICEDir , dir );
- prgt = malloc( strlen( DICEDir ) + 10 );
- strcpy( prgt , DICEDir );
- strcat( prgt , "/bin/" );
- ReplaceChar( &PrgDir , prgt );
- free( prgt );
- }
-
- /****************************************************************
- *** Lance l'edition d'un module spécifié par son nom ***
- ****************************************************************/
-
- void EditModule( char *name ) {
- char *buf;
- struct TagItem *ti;
-
- ti = FindTagItem( SA_PubName , ScreenTags );
- if ( ti )
- SetDefaultPubScreen( (char *)(ti->ti_Data) );
- buf = malloc( strlen( PrgDir ) + strlen( name ) + 20 );
- strcpy( buf , Editor );
- strcat( buf , " \"" );
- strcat( buf , name );
- strcat( buf , "\"" );
- Launch( buf , TRUE );
- free( buf );
- }
-
- /****************************************************************
- *** Gestion des fichiers de commentaires ***
- ****************************************************************/
-
- char *CommentName( char *module ) {
- char *result;
-
- result = malloc( strlen( module ) + 10 );
- strcpy( result , module );
- strcat( result , ".comment" );
- return( result );
- }
-
- BOOL IsCommented( char *module ) {
- char *modulec;
- struct FileInfoBlock fib;
- BOOL r=FALSE;
-
- modulec = CommentName( module );
- if ( GetInfo( &fib , modulec ) ) {
- r = TRUE;
- }
- free( modulec );
- return( r );
- }
-
-
-